package model;

import java.text.DecimalFormat;

public class Result {
	
	//resources
	private Double result;
	private long time;
	private int core;
	private int poolSize;
	
	//default constructor
	public Result(){
		result=0.0;
		time=0;
		core=0;
		poolSize=0;
	}
	
	
	public String toString(){
		String s = new String();
		String Sresult = new DecimalFormat("##,##0.0000").format(result); //format result
		
		//single thread : no need to display core & poolsize data
		if(core==0){
			s= "Result = " + Sresult + "\nTime : " + time + " milliseconds";
		}
		else{
			s= "Result = " + Sresult + "\nTime : " + time + " milliseconds"
				+ "\nNumber of cores : " + core + "\nPool size : " + poolSize;
		}
		
		return s;
	}
	
	//Accessors
	public Double getResult() {
		return result;
	}
	public void setResult(Double result) {
		this.result = result;
	}
	public long getTime() {
		return time;
	}
	public void setTime(long time) {
		this.time = time;
	}

	public int getCore() {
		return core;
	}

	public void setCore(int core) {
		this.core = core;
	}

	public int getPoolSize() {
		return poolSize;
	}

	public void setPoolSize(int poolSize) {
		this.poolSize = poolSize;
	}
	
}
